package com.navi.loaddata.core.oracleEntity;

import com.navi.loaddata.core.oracleEntity.array.EtlArrayDefectV;
import com.navi.loaddata.core.oracleEntity.cell1.EtlCellComponentV;
import com.navi.loaddata.core.oracleEntity.cell1.EtlCellDefectV;
import com.navi.loaddata.core.oracleEntity.cell2.EtlCell2DefectV;
import com.navi.loaddata.core.oracleEntity.cf.EtlCfDefectV;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Created by Jay on 2018/3/27.
 */

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface EtlDefectVMapper {

    EtlDefectVMapper INSTANCE = Mappers.getMapper(EtlDefectVMapper.class);

    EtlArrayDefectV etlDefectToArray(EtlDefectV defectVMapper);
    List<EtlArrayDefectV> etlDefectToArray(List<EtlDefectV> list);

    EtlCfDefectV etlDefectToCf(EtlDefectV defectVMapper);
    List<EtlCfDefectV> etlDefectToCf(List<EtlDefectV> list);


    @Mapping(target = "componentId",source = "glassId")//属性名不一致映射
    @Mapping(target = "componentEndTime",source = "glassEndTime")//属性名不一致映射
    EtlCellDefectV etlDefectToCell1(EtlDefectV defectVMapper);
    List<EtlCellDefectV> etlDefectToCell1(List<EtlDefectV> list);


    @Mapping(target = "chipEndTime", source = "glassEndTime")//属性名不一致映射
    @Mapping(target = "panelX", source = "x")//属性名不一致映射
    @Mapping(target = "panelY", source = "y")//属性名不一致映射
    @Mapping(target = "panelX2", source = "x2")//属性名不一致映射
    @Mapping(target = "panelY2", source = "y2")//属性名不一致映射
    @Mapping(target = "panelX3", source = "x3")//属性名不一致映射
    @Mapping(target = "panelY3", source = "y3")//属性名不一致映射
    @Mapping(target = "glassX", source = "arrayX")//属性名不一致映射
    @Mapping(target = "glassY", source = "arrayY")//属性名不一致映射
    @Mapping(target = "glassX2", source = "arrayX2")//属性名不一致映射
    @Mapping(target = "glassY2", source = "arrayY2")//属性名不一致映射
    @Mapping(target = "glassX3", source = "arrayX3")//属性名不一致映射
    @Mapping(target = "glassY3", source = "arrayY3")//属性名不一致映射
    EtlCell2DefectV etlDefectToCell2(EtlDefectV defectVMapper);
    List<EtlCell2DefectV> etlDefectToCell2(List<EtlDefectV> list);

}
